#coding:utf-8
from django import template
import json
register = template.Library()

@register.filter(name='json_data')  ##装饰器
def json_data(value):

    jj=json.dumps(value)

    return jj

@register.filter(name='code_gbk')  ##装饰器
def code_data(value):

    jj=value.decode('gbk').encode('utf-8')

    return jj